<?xml version='1.0' encoding='iso-8859-1'?>
<!doctype html public '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3c.org/1999/xhtml' lang='en-us'>
	<head>
		<title>
			types.h
			</title>
		<meta http-equiv='content-type' content='text/html;iso-8859-1'/>
		<meta name='generator' content='motley-tools 1.9.4 13:40:33 Feb 18 2015'/>
		<meta name='author' content='cmaier@cmassoc.net'/>
		<meta name='robots' content='noindex,nofollow'/>
		<link href='toolkit.css' rel='stylesheet' type='text/css'/>
		</head>
	<body>
		<div class='headerlink'>
			[<a href='tlv.h.html' title=' tlv.h '>PREV</a>]
			[<a href='toolkit.html' title=' Index '>HOME</a>]
			[<a href='unistd.h.html' title=' unistd.h '>NEXT</a>]
			</div>
<pre>
/*====================================================================*
 *
 *   types.h - custom data type definitions and declarations;
 *
 *   this file is a subset of the original that includes only those
 *   definitions and declaration needed for toolkit programs;
 *
 *   Motley Tools by Charles Maier &lt;cmaier@cmassoc.net&gt;;
 *   Copyright 2001-2006 by Charles Maier Associates;
 *   Licensed under the Internet Software Consortium License;
 *
 *   Contributor(s):
 *
 *   Werner Henze &lt;w.henze@avm.de&gt;
 *
 *--------------------------------------------------------------------*/

#ifndef TYPES_HEADER
#define TYPES_HEADER

/*====================================================================*
 *   system header files;
 *--------------------------------------------------------------------*/

#include &lt;stdint.h&gt;

/*====================================================================*
 *   constants;
 *--------------------------------------------------------------------*/

#if defined (_WIN64)
	#define SIZE_T_SPEC &quot;%I64d&quot;
	#define OFF_T_SPEC &quot;%ld&quot;
#elif defined (WIN32)
	#define SIZE_T_SPEC &quot;%d&quot;
	#define OFF_T_SPEC &quot;%ld&quot;
#elif defined (__APPLE__)
	#define SIZE_T_SPEC &quot;%zu&quot;
	#define OFF_T_SPEC &quot;%lld&quot;
#elif defined (__OpenBSD__)
	#define SIZE_T_SPEC &quot;%zu&quot;
	#define OFF_T_SPEC &quot;%lld&quot;
#elif defined (__linux__)
	#define SIZE_T_SPEC &quot;%zu&quot;
	#define OFF_T_SPEC &quot;%ld&quot;
#else
error &quot;Unknown environment.&quot;
#endif

/*====================================================================*
 *   macros;
 *--------------------------------------------------------------------*/

#define MONIKER(x) #x
#define LITERAL(x) MONIKER(x)
#define SIZEOF(array) (sizeof(array)/sizeof(array[0]))

/*====================================================================*
 *   new POSIX types;
 *--------------------------------------------------------------------*/

typedef signed errno_t;
typedef signed signo_t;
typedef unsigned char byte;

/*====================================================================*
 *   define C++ style true and false for use in standard C programs;
 *--------------------------------------------------------------------*/

#ifndef __cplusplus

typedef enum

{
	false,
	true
}

bool;

#endif

/*====================================================================*
 *   cope with structure packing vagaries;
 *--------------------------------------------------------------------*/

#ifndef __packed
#ifdef __GNUC__
#define __packed __attribute__ ((packed))
#else
#define __packed
#endif
#endif

/*====================================================================*
 *   define flagword (bitmap) variable type for clarity;
 *--------------------------------------------------------------------*/

typedef signed file_t;
typedef signed sock_t;
typedef signed code_t;
typedef unsigned char byte_t;
typedef unsigned type_t;
typedef unsigned flag_t;
typedef struct _file_

{
	file_t file;
	char const *name;
}

file;
typedef struct _term_

{
	char const * term;
	char const * text;
}

TERM;
typedef struct _type_

{
	type_t type;
	char const * name;
}

TYPE;
typedef struct _code_

{
	code_t code;
	char const * name;
}

CODE;

/*====================================================================*
 *   end definitions and declarations;
 *--------------------------------------------------------------------*/

#endif


</pre>
		<div class='footerlink'>
			[<a href='tlv.h.html' title=' tlv.h '>PREV</a>]
			[<a href='toolkit.html' title=' Index '>HOME</a>]
			[<a href='unistd.h.html' title=' unistd.h '>NEXT</a>]
			</div>
		</body>
	</html>
